home *** CD-ROM | disk | FTP | other *** search
/ AMIGA-CD 2 / Amiga-CD - Volume 2.iso / gepackte_disketten / 1994 / 08_94_5.dms / 08_94_5.adf / term-4.0-Source.lha / termGlobal.h < prev    next >
Text File  |  1994-07-08  |  36KB  |  1,396 lines

  1. /*
  2. **    termGlobal.h
  3. **
  4. **    Global data structure definitions
  5. **
  6. **    Copyright © 1990-1994 by Olaf `Olsen' Barthel
  7. **        All Rights Reserved
  8. */
  9.  
  10.     /* Jump table entry. */
  11.  
  12. typedef BYTE (*  JUMP)(UBYTE Char);
  13.  
  14.     /* Pointer to function returning nothing. */
  15.  
  16. typedef VOID (* VPTR)();
  17.  
  18.     /* Menu item codes. */
  19.  
  20. enum    {    MEN_SAVE_AS_PICTURE=1,MEN_SAVE_AS_TEXT,MEN_PRINT_SCREEN,MEN_PRINT_CLIP,MEN_CAPTURE_TO_FILE,
  21.         MEN_CAPTURE_TO_PRINTER,MEN_ICONIFY,MEN_ABOUT,MEN_QUIT,
  22.  
  23.         MEN_COPY,MEN_PASTE,MEN_CLEAR,
  24.  
  25.         MEN_EXECUTE_DOS_COMMAND,MEN_EXECUTE_REXX_COMMAND,MEN_RECORD,MEN_RECORD_LINE,
  26.         MEN_EDIT_TRAPS,MEN_DISABLE_TRAPS,
  27.  
  28.         MEN_PHONEBOOK,MEN_REDIAL,MEN_DIAL_NUMBER,MEN_SEND_BREAK,
  29.         MEN_HANG_UP,MEN_WAIT,MEN_FLUSH_BUFFER,MEN_RELEASE_DEVICE,
  30.  
  31.         MEN_UPLOAD_ASCII,MEN_DOWNLOAD_ASCII,MEN_UPLOAD_TEXT,MEN_DOWNLOAD_TEXT,MEN_EDIT_AND_UPLOAD_TEXT,
  32.         MEN_UPLOAD_BINARY,MEN_DOWNLOAD_BINARY,
  33.  
  34.         MEN_CLEAR_BUFFER,MEN_DISPLAY_BUFFER,MEN_CLOSE_BUFFER,MEN_FREEZE_BUFFER,MEN_OPEN_BUFFER,
  35.         MEN_SAVE_BUFFER_AS,
  36.  
  37.         MEN_CLEAR_SCREEN,MEN_RESET_FONT,MEN_RESET_STYLES,MEN_RESET_TERMINAL,
  38.  
  39.         MEN_SERIAL,MEN_MODEM,MEN_SCREEN,MEN_TERMINAL,MEN_SET_EMULATION,MEN_CLIPBOARD,MEN_CAPTURE,MEN_COMMANDS,
  40.         MEN_MISC,MEN_PATH,MEN_TRANSFER_PROTOCOL,MEN_TRANSFER,MEN_TRANSLATION,MEN_MACROS,
  41.         MEN_CURSORKEYS,MEN_FAST_MACROS,MEN_HOTKEYS,MEN_SPEECH,MEN_SOUND,MEN_SET_CONSOLE,MEN_OPEN_SETTINGS,MEN_SAVE_SETTINGS,
  42.         MEN_SAVE_SETTINGS_AS,
  43.  
  44.         MEN_STATUS_WINDOW,MEN_REVIEW_WINDOW,MEN_PACKET_WINDOW,MEN_FAST_MACROS_WINDOW,
  45.         MEN_UPLOAD_QUEUE_WINDOW
  46.     };
  47.  
  48.     /* Menu item code limit, required by the quick dial menu. */
  49.  
  50. #define DIAL_MENU_LIMIT 1000
  51.  
  52.     /* How many phone book entries will be stored in
  53.      * the quick dial menu.
  54.      */
  55.  
  56. #define DIAL_MENU_MAX    50
  57.  
  58.     /* Undefine the following symbols, the preferences header file
  59.      * will use the same names and the same values.
  60.      */
  61.  
  62. #undef PARITY_NONE
  63. #undef PARITY_EVEN
  64. #undef PARITY_ODD
  65. #undef PARITY_MARK
  66. #undef PARITY_SPACE
  67.  
  68.     /* Serial settings. */
  69.  
  70. enum    {    PARITY_NONE,PARITY_EVEN,PARITY_ODD,PARITY_MARK,PARITY_SPACE };
  71.  
  72. enum    {    HANDSHAKING_NONE,HANDSHAKING_RTSCTS,HANDSHAKING_RTSCTS_DSR };
  73. enum    {    DUPLEX_FULL,DUPLEX_HALF };
  74. enum    {    FLOW_NONE,FLOW_XON_XOFF };
  75.  
  76.     /* Terminal settings. */
  77.  
  78. enum    {    CR_IGNORE,CR_ASCR,CR_ASCRLF };
  79. enum    {    LF_IGNORE,LF_ASLF,LF_ASLFCR };
  80. enum    {    EMULATION_ANSIVT100,EMULATION_ATOMIC,EMULATION_TTY,EMULATION_EXTERNAL,EMULATION_HEX };
  81. enum    {    COLOUR_AMIGA,COLOUR_EIGHT,COLOUR_SIXTEEN,COLOUR_MONO };
  82.  
  83.     /* Protocol types. */
  84.  
  85. enum    {    PROTOCOL_XMODEM,PROTOCOL_XMODEMCRC,PROTOCOL_YMODEM,PROTOCOL_ZMODEM };
  86.  
  87.     /* Font types. */
  88.  
  89. enum    {    FONT_STANDARD,FONT_IBM,FONT_IBM_RAW };
  90.  
  91.     /* Bell modes. */
  92.  
  93. enum    {    BELL_NONE, BELL_VISIBLE, BELL_AUDIBLE, BELL_BOTH, BELL_SYSTEM };
  94.  
  95.     /* Data flow scanner indices. */
  96.  
  97. enum    {    SCAN_NOCARRIER, SCAN_ZMODEM, SCAN_CONNECT, SCAN_VOICE, SCAN_RING, SCAN_BUSY, SCAN_NODIALTONE,
  98.         SCAN_OK, SCAN_ERROR, SCAN_COUNT };
  99.  
  100.     /* Status types. */
  101.  
  102. enum    {    STATUS_READY,STATUS_HOLDING,STATUS_DIALING,STATUS_UPLOAD,
  103.         STATUS_DOWNLOAD,STATUS_BREAKING,STATUS_HANGUP,
  104.         STATUS_RECORDING,STATUS_RECORDING_LINE
  105.     };
  106.  
  107.     /* Sound types. */
  108.  
  109. enum    {    SOUND_BELL,SOUND_CONNECT,SOUND_DISCONNECT,SOUND_GOODTRANSFER,
  110.         SOUND_BADTRANSFER,SOUND_RING,SOUND_VOICE,SOUND_COUNT };
  111.  
  112.     /* Settings types. */
  113.  
  114. enum    {    PREF_ALL,PREF_SERIAL,PREF_MODEM,PREF_COMMAND,PREF_SCREEN,
  115.         PREF_TERMINAL,PREF_PATH,PREF_MISC,PREF_CLIP,PREF_CAPTURE,
  116.         PREF_FILE,PREF_EMULATION,PREF_TRANSFER };
  117.  
  118.     /* Status line modes. */
  119.  
  120. enum    {    STATUSLINE_DISABLED,STATUSLINE_STANDARD,STATUSLINE_COMPRESSED };
  121.  
  122.     /* Capture filter modes. */
  123.  
  124. enum    {    FILTER_NONE,FILTER_ESCAPE,FILTER_CONTROL,FILTER_BOTH };
  125.  
  126.     /* Scrolling modes. */
  127.  
  128. enum    {    SCROLL_JUMP,SCROLL_SMOOTH };
  129.  
  130.     /* Auto-capture file creation. */
  131.  
  132. enum    {    AUTOCAPTURE_DATE_NAME,AUTOCAPTURE_DATE_INCLUDE };
  133.  
  134.     /* Cursor and numeric keypad modes. */
  135.  
  136. enum    {    KEYMODE_STANDARD,KEYMODE_APPLICATION };
  137.  
  138.     /* Font scales. */
  139.  
  140. enum    {    SCALE_NORMAL,SCALE_HALF };
  141. enum    {    SCALE_ATTR_NORMAL,SCALE_ATTR_TOP2X,SCALE_ATTR_BOT2X,SCALE_ATTR_2X };
  142.  
  143.     /* Character tables. */
  144.  
  145. enum    {    TABLE_ASCII,TABLE_GFX };
  146.  
  147.     /* Transfer types. */
  148.  
  149. enum    {    TRANSFER_BINARY,TRANSFER_TEXT,TRANSFER_ASCII };
  150.  
  151.     /* Translation table entry types. */
  152.  
  153. enum    {    TRANSLATE_SINGLE,TRANSLATE_STRING };
  154.  
  155.     /* Upload panel actions. */
  156.  
  157. enum    {    UPLOAD_TEXT=1,UPLOAD_BINARY,UPLOAD_IGNORE,UPLOAD_ABORT,
  158.         UPLOAD_TEXT_FROM_LIST,UPLOAD_BINARY_FROM_LIST
  159.     };
  160.  
  161.     /* Alert types. */
  162.  
  163. enum    {    ALERT_NONE,ALERT_BEEP,ALERT_SCREEN,ALERT_BEEP_SCREEN };
  164.  
  165.     /* Online time display modes. */
  166.  
  167. enum    {    ONLINETIME_TIME,ONLINETIME_COST,ONLINETIME_BOTH };
  168.  
  169.     /* Clipboard read errors. */
  170.  
  171. enum    {    CLIPERR_NONE,CLIPERR_NOTEXT,CLIPERR_IFF,CLIPERR_OPEN,CLIPERR_MEM };
  172.  
  173.     /* What to print. */
  174.  
  175. enum    {    PRINT_SCREEN,PRINT_CLIP };
  176.  
  177.     /* Dial command types. */
  178.  
  179. enum    {    DIAL_IGNORE,DIAL_LIST,DIAL_REDIAL };
  180.  
  181.     /* Errors returned by ReconfigureSerial(). */
  182.  
  183. enum    {    RECONFIGURE_FAILURE,RECONFIGURE_NOCHANGE,RECONFIGURE_SUCCESS };
  184.  
  185.     /* Operation codes for SetItem(). */
  186.  
  187. enum    {    SETITEM_SETCHECK,SETITEM_CLRCHECK,SETITEM_ON,SETITEM_OFF };
  188.  
  189.     /* File identification actions. */
  190.  
  191. enum    {    IDENTIFY_IGNORE,IDENTIFY_FILETYPE,IDENTIFY_SOURCE };
  192.  
  193.     /* Generic list types. */
  194.  
  195. enum    {    GLIST_UPLOAD,GLIST_DOWNLOAD,GLIST_DIAL,GLIST_WAIT,GLIST_TRAP,GLIST_COUNT };
  196.  
  197.     /* Generic list add operations. */
  198.  
  199. enum    {    ADD_GLIST_BOTTOM,ADD_GLIST_TOP,ADD_GLIST_BEHIND,ADD_GLIST_BEFORE };
  200.  
  201.     /* Transfer window gadgets. */
  202.  
  203. enum    {    GAD_TRANSFER_INFORMATION_LIST=1,
  204.         GAD_TRANSFER_PERCENT,GAD_TRANSFER_TIME,
  205.         GAD_TRANSFER_ABORT,GAD_TRANSFER_SKIP,
  206.         GAD_TRANSFER_PROTOCOL,GAD_TRANSFER_FILE,
  207.         GAD_TRANSFER_SIZE,GAD_TRANSFER_SECONDS,
  208.         GAD_TRANSFER_TOTALTIME,GAD_TRANSFER_ERRORS,
  209.         GAD_TRANSFER_ABORT_FILE
  210.     };
  211.  
  212.     /* XPR options setting. */
  213.  
  214. enum    {    GAD_XPROPTIONS_USE=42,GAD_XPROPTIONS_CANCEL };
  215.  
  216.     /* AmigaGuide help context. */
  217.  
  218. enum    {    CONTEXT_MAIN,CONTEXT_SERIAL,CONTEXT_MODEM,CONTEXT_SCREEN,
  219.         CONTEXT_TERMINAL,CONTEXT_CLIP,CONTEXT_CAPTURE,CONTEXT_COMMAND,
  220.         CONTEXT_MISC,CONTEXT_PATHS,CONTEXT_TRANSLATION,CONTEXT_MACROS,
  221.         CONTEXT_CURSOR,CONTEXT_FASTMACROS,CONTEXT_HOTKEYS,CONTEXT_SPEECH,
  222.         CONTEXT_EMULATION,CONTEXT_TRANSFER,CONTEXT_PHONEBOOK,CONTEXT_DATE,
  223.         CONTEXT_DAY,CONTEXT_IMPORT,CONTEXT_RATES,CONTEXT_TIME,
  224.         CONTEXT_COPY,CONTEXT_PASSWORDUSER,CONTEXT_DIAL,CONTEXT_PRINT,
  225.         CONTEXT_TEXTBUFFER,CONTEXT_PACKETWINDOW,CONTEXT_SOUND,
  226.         CONTEXT_LIBS,CONTEXT_ASCII,CONTEXT_PENS };
  227.  
  228.     /* Character types. */
  229.  
  230. enum    {    CHAR_VANILLA,CHAR_CURSOR,CHAR_FUNCTION,CHAR_HELP,
  231.         CHAR_XON,CHAR_XOFF,CHAR_ENTER,CHAR_RETURN };
  232.  
  233.     /* Review window positioning codes. */
  234.  
  235. enum    {    REVIEW_MOVE_TOP,REVIEW_MOVE_BOTTOM,REVIEW_MOVE_UP,REVIEW_MOVE_DOWN };
  236.  
  237.     /* File type classes. */
  238.  
  239. enum    {    FILETYPE_NONE,FILETYPE_DIR,FILETYPE_FILE,FILETYPE_TEXT,FILETYPE_SOUND,
  240.         FILETYPE_PICTURE,FILETYPE_PREFS,FILETYPE_ARCHIVE,
  241.         FILETYPE_PROGRAM,
  242.  
  243.         FILETYPE_COUNT };
  244.  
  245.     /* Text pacing modes. */
  246.  
  247. enum    {    PACE_DIRECT,PACE_ECHO,PACE_ANYECHO,PACE_PROMPT,PACE_DELAY,PACE_KEYBOARD };
  248.  
  249.     /* Where to open the buffer text window. */
  250.  
  251. enum    {    BUFFER_TOP,BUFFER_END };
  252.  
  253.     /* Where to place the buffer screen horizontally. */
  254.  
  255. enum    {    SCREEN_LEFT,SCREEN_CENTRE,SCREEN_RIGHT };
  256.  
  257.     /* Some raw key codes. */
  258.  
  259. #define HELP_CODE        95
  260. #define RAMIGA_CODE        103
  261.  
  262. #define CURSOR_UP_CODE        76
  263. #define CURSOR_DOWN_CODE    77
  264. #define CURSOR_RIGHT_CODE    78
  265. #define CURSOR_LEFT_CODE    79
  266.  
  267. #define F01_CODE        80
  268. #define F02_CODE        81
  269. #define F03_CODE        82
  270. #define F04_CODE        83
  271. #define F05_CODE        84
  272. #define F06_CODE        85
  273. #define F07_CODE        86
  274. #define F08_CODE        87
  275. #define F09_CODE        88
  276. #define F10_CODE        89
  277.  
  278.     /* A couple of useful minterms. */
  279.  
  280. #define MINTERM_ZERO        0
  281. #define MINTERM_ONE        ABC | ABNC | ANBC | ANBNC | NABC | NABNC | NANBC | NANBNC
  282. #define MINTERM_COPY        ABC | ABNC | NABC | NABNC
  283. #define MINTERM_NOT_C        ABNC | ANBNC | NABNC | NANBNC
  284. #define MINTERM_B_AND_C        ABC | NABC
  285. #define MINTERM_NOT_B_AND_C    ANBC | NANBC
  286. #define MINTERM_B_OR_C        ABC | ABNC | NABC | NABNC | ANBC | NANBC
  287.  
  288.     /* Printer control bits. */
  289.  
  290. #define PRINT_SERIAL    (1L << 0)
  291. #define PRINT_MODEM    (1L << 1)
  292. #define PRINT_SCREEN    (1L << 2)
  293. #define PRINT_TERMINAL    (1L << 3)
  294. #define PRINT_USERNAME    (1L << 4)
  295. #define PRINT_COMMENT    (1L << 5)
  296. #define PRINT_SIZE    (1L << 6)
  297. #define PRINT_DATE    (1L << 7)
  298. #define PRINT_BITS    (1L << 8)
  299.  
  300.     /* Day of week flags. */
  301.  
  302. #define DAY_MONDAY    (1L << 0)
  303. #define DAY_TUESDAY    (1L << 1)
  304. #define DAY_WEDNESDAY    (1L << 2)
  305. #define DAY_THURSDAY    (1L << 3)
  306. #define DAY_FRIDAY    (1L << 4)
  307. #define DAY_SATURDAY    (1L << 5)
  308. #define DAY_SUNDAY    (1L << 6)
  309.  
  310.     /* These signal masks will make life a bit easier. */
  311.  
  312. #define SIG_WINDOW    (1L << Window -> UserPort -> mp_SigBit)
  313. #define SIG_SERIAL    (ReadPort ? 1L << ReadPort -> mp_SigBit : NULL)
  314. #define SIG_TIMER    (1L << TimePort -> mp_SigBit)
  315. #define SIG_QUEUE    (SpecialQueue -> SigMask)
  316. #define SIG_CHECK    (1L << CheckBit)
  317. #define SIG_WORKBENCH    (1L << WorkbenchPort -> mp_SigBit)
  318. #define SIG_REXX    (1L << TermRexxPort -> mp_SigBit)
  319.  
  320.     /* Task termination and handshake signal. Note: don't try this at
  321.      * home kids, we are all trained professionals here!
  322.      */
  323.  
  324. #define SIG_KILL    SIGBREAKF_CTRL_C
  325. #define SIG_HANDSHAKE    SIGF_SINGLE
  326.  
  327.     /* Double-buffered file server command. */
  328.  
  329. #define    SIG_COMMAND    SIGBREAKF_CTRL_D
  330.  
  331.     /* ARexx break signal. */
  332.  
  333. #define SIG_BREAK    SIGBREAKF_CTRL_D
  334.  
  335.     /* Hotkey reset command. */
  336.  
  337. #define SIG_RESET    SIGBREAKF_CTRL_D
  338.  
  339.     /* Skip dial entry. */
  340.  
  341. #define SIG_SKIP    SIGBREAKF_CTRL_D
  342.  
  343.     /* Status commands. */
  344.  
  345. #define SIG_BELL    SIGBREAKF_CTRL_D
  346. #define SIG_RESETTIME    SIGBREAKF_CTRL_E
  347.  
  348.     /* Buffer special signals. */
  349.  
  350. #define SIG_TOFRONT    SIGBREAKF_CTRL_D
  351. #define SIG_UPDATE    SIGBREAKF_CTRL_E
  352. #define SIG_MOVEUP    SIGBREAKF_CTRL_F
  353.  
  354.     /* Status display task. */
  355.  
  356. #define SIG_CLOSEWINDOW    SIGBREAKF_CTRL_F
  357.  
  358.     /* Upload queue. */
  359.  
  360. #define SIG_SHOW    SIGBREAKF_CTRL_D
  361. #define SIG_HIDE    SIGBREAKF_CTRL_E
  362. #define SIG_GOAWAY    SIGBREAKF_CTRL_F
  363.  
  364.     /* A port signal mask. */
  365.  
  366. #define PORTMASK(P)    (1L << (((struct MsgPort *)(P)) -> mp_SigBit))
  367.  
  368.     /* Replacements for CheckItem() and OnMenu()/OffMenu(). */
  369.  
  370. #define CheckItem(ID,Mode)    SetItem(ID,Mode ? SETITEM_SETCHECK : SETITEM_CLRCHECK)
  371. #define OnItem(ID)        SetItem(ID,SETITEM_ON)
  372. #define OffItem(ID)        SetItem(ID,SETITEM_OFF)
  373.  
  374.     /* A handy signal macro. */
  375.  
  376. #define ClrSignal(Signals)    SetSignal(0,Signals)
  377.  
  378.     /* Another neat macro. */
  379.  
  380. #define NumElements(s)        (sizeof(s) / sizeof((s)[0]))
  381.  
  382.     /* Definitions to access the line signal setting functions supported by
  383.      * some IO serial boards (namely the ASDG board).
  384.      */
  385.  
  386. #define SIOCMD_SETCTRLLINES    (CMD_NONSTD + 7)
  387. #define SIOB_RTSB        0
  388. #define SIOB_DTRB        1
  389. #define SIOB_RTSF        (1L << SIOB_RTSB)
  390. #define SIOB_DTRF        (1L << SIOB_DTRB)
  391.  
  392.     /* Turn time of day into `compressed' format. */
  393.  
  394. #define DT_GET_TIME(Hour,Minute) ((Minute) / 10 + (Hour) * 6)
  395.  
  396.     /* Vector offsets for the TimeDate structure. */
  397.  
  398. enum    { DT_FIRST_UNIT,DT_NEXT_UNIT };
  399.  
  400.     /* Multiply lines and columns with the current font size. */
  401.  
  402. #define MUL_X(x)        OffsetXTable[x]
  403. #define MUL_Y(y)        OffsetYTable[y]
  404.  
  405.     /* A handy and short alias. */
  406.  
  407. #define TICK            (CHECKIT | MENUTOGGLE)
  408.  
  409.     /* For now the maximum length of a path/file name. */
  410.  
  411. #define MAX_FILENAME_LENGTH    256
  412.  
  413.     /* The maximum width of a line to be stored in the text buffer. */
  414.  
  415. #define BUFFER_LINE_MAX        255
  416.  
  417.     /* User interface definitions. */
  418.  
  419. #define SZ_AutoWidth    TAG_USER+2    /* Use default width? */
  420. #define SZ_NewColumn    TAG_USER+4    /* Start new column */
  421. #define SZ_Lines    TAG_USER+5    /* Number of lines in object */
  422.  
  423.     /* Box information types. */
  424.  
  425. enum    {    BOX_LEFT,BOX_TOP,BOX_WIDTH,BOX_HEIGHT };
  426.  
  427.     /* Status gadget properties. */
  428.  
  429. #define SGA_FullWidth    (TAG_USER+42)
  430. #define SGA_Mode    (TAG_USER+43)
  431.  
  432.     /* Sizing gadget sizes. */
  433.  
  434. #define SIZE_GADGET_WIDTH_HIGH    18
  435. #define SIZE_GADGET_WIDTH_LOW    13
  436.  
  437.     /* Some windows to be opened on the main screen. */
  438.  
  439. enum    {    WINDOW_PACKET,WINDOW_STATUS,WINDOW_FILE,
  440.         WINDOW_REVIEW,WINDOW_FAST,WINDOW_FONT,
  441.         WINDOW_SCREEN,WINDOW_PERF,
  442.  
  443.         WINDOW_COUNT };
  444.  
  445.     /* Window alignment information. */
  446.  
  447. #define WC_ALIGNLEFT    (1<<0)
  448. #define WC_ALIGNRIGHT    (1<<1)
  449. #define WC_ALIGNTOP    (1<<2)
  450. #define WC_ALIGNBOTTOM    (1<<3)
  451. #define WC_EXPANDWIDTH    (1<<4)
  452. #define WC_EXPANDHEIGHT    (1<<5)
  453. #define WC_ALIGNSIDE    (1<<6)
  454. #define WC_ALIGNBELOW    (1<<7)
  455.  
  456.     /* Trap management. */
  457.  
  458. struct TrapNode
  459. {
  460.     struct Node    Node;
  461.     LONG        Count,
  462.             SequenceLen;
  463.     STRPTR        Sequence,
  464.             Command;
  465. };
  466.  
  467.     /* Trap preferences, not much. */
  468.  
  469. struct TrapSettings
  470. {
  471.     BYTE        Enabled,
  472.             Pad;
  473. };
  474.  
  475.     /* Window alignment data. */
  476.  
  477. struct WindowInfo
  478. {
  479.     UWORD    ID;
  480.     UWORD    WindowFlags;
  481.  
  482.     LONG    Left,
  483.         Top,
  484.         Width,
  485.         Height;
  486. };
  487.  
  488.     /* Special character treatment. */
  489.  
  490. struct SpecialKey
  491. {
  492.     UBYTE    Key;
  493.     BYTE    (*  Routine)(VOID);
  494. };
  495.  
  496.     /* Cursor backup data. */
  497.  
  498. struct CursorData
  499. {
  500.     struct TextFont        *CurrentFont;
  501.     WORD             CursorX,
  502.                  CursorY;
  503.     BYTE             Charset;
  504.     BYTE             CharMode[2];
  505.     BYTE             Attributes;
  506.     BYTE             FgPen,
  507.                  BgPen;
  508.     UBYTE             Style;
  509. };
  510.  
  511.     /* File transfer information. */
  512.  
  513. struct FileTransferNode
  514. {
  515.     struct MinNode         Node;
  516.     ULONG             Size;
  517.     STRPTR             Name;
  518. };
  519.  
  520. struct FileTransferInfo
  521. {
  522.     struct MinList         FileList;
  523.     ULONG             TotalSize;
  524.     LONG             TotalFiles;
  525.  
  526.     ULONG             DoneSize;
  527.     LONG             DoneFiles;
  528.  
  529.     struct FileTransferNode    *CurrentFile;
  530.     ULONG             CurrentSize;
  531. };
  532.  
  533.     /* Global data link. */
  534.  
  535. struct TermPort
  536. {
  537.     struct MsgPort         ExecNode;
  538.  
  539.     struct Window        *TopWindow;
  540.  
  541.     struct SignalSemaphore     OpenSemaphore;
  542.  
  543.     LONG             ID,OpenCount,HoldIt;
  544.     LONG             Reserved[5];
  545. };
  546.  
  547.     /* Buffer search support. */
  548.  
  549. struct SearchInfo
  550. {
  551.     UBYTE    Distance[256],
  552.         Pattern[256];
  553.     LONG    FoundX,
  554.         FoundY;
  555.     WORD    PatternWidth;
  556.     WORD    Index;
  557.     BOOLEAN    Forward,
  558.         IgnoreCase;
  559. };
  560.  
  561.     /* Support for optimized scrolling routines. */
  562.  
  563. struct ScrollLineInfo
  564. {
  565.     UWORD             Left,Right,Width,
  566.                  ColourMask;
  567. };
  568.  
  569.     /* A dial list entry. */
  570.  
  571. struct PhoneNode
  572. {
  573.     struct Node         VanillaNode;
  574.  
  575.     UBYTE             LocalName[50];
  576.  
  577.     struct PhoneEntry    *Entry;
  578. };
  579.  
  580.     /* A Fast! macro list entry. */
  581.  
  582. struct MacroNode
  583. {
  584.     struct MacroNode    *mn_Succ;    /* Modeled after the default Node. */
  585.     struct MacroNode    *mn_Pred;
  586.  
  587.     WORD             mn_Pad;    /* Included only for Node compatibility. */
  588.  
  589.     UBYTE            *mn_Macro;    /* = ln_Name, title */
  590.     UBYTE            *mn_Code;    /* The execution code. */
  591. };
  592.  
  593.     /* Speech preferences. */
  594.  
  595. struct SpeechConfig
  596. {
  597.     WORD            Rate,
  598.                 Pitch;
  599.     LONG            Frequency;
  600.     BYTE            Sex,
  601.                 Volume,
  602.                 Enabled,
  603.                 Pad;
  604. };
  605.  
  606.     /* Sound preferences */
  607.  
  608. struct SoundConfig
  609. {
  610.     UBYTE            BellFile[MAX_FILENAME_LENGTH],
  611.  
  612.                 ConnectFile[MAX_FILENAME_LENGTH],
  613.                 DisconnectFile[MAX_FILENAME_LENGTH],
  614.  
  615.                 GoodTransferFile[MAX_FILENAME_LENGTH],
  616.                 BadTransferFile[MAX_FILENAME_LENGTH],
  617.  
  618.                 RingFile[MAX_FILENAME_LENGTH],
  619.                 VoiceFile[MAX_FILENAME_LENGTH];
  620.  
  621.     BYTE            Preload,
  622.                 Pad;
  623.     BYTE            Volume,
  624.                 Pad2;
  625. };
  626.  
  627.     /* Macro Preferences. */
  628.  
  629. struct MacroKeys
  630. {
  631.     UBYTE            Keys[4][10][256];
  632. };
  633.  
  634.     /* Cursor key preferences. */
  635.  
  636. struct CursorKeys
  637. {
  638.     UBYTE            Keys[4][4][256];
  639. };
  640.  
  641.     /* Translation table entry. */
  642.  
  643. struct TranslationEntry
  644. {
  645.     STRPTR            String;        /* Corresponding code string. */
  646.     UBYTE            Type;        /* Table entry type. */
  647.     UBYTE            Len;        /* String length if any. */
  648.     UBYTE            Extra;        /* Saves space, don't need to allocate memory for this one. */
  649.     UBYTE            Null;        /* Terminating null. */
  650. };
  651.  
  652. struct TranslationHeader
  653. {
  654.     UBYTE            Type;        /* Table entry type. */
  655.     UBYTE            Code;        /* Table offset. */
  656.     UBYTE            Len;        /* Entry length. */
  657.     UBYTE            Pad;
  658. };
  659.  
  660.     /* Buffer translation handle. */
  661.  
  662. struct TranslationHandle
  663. {
  664.     STRPTR            LocalBuffer;
  665.     LONG            LocalLen;
  666.  
  667.     STRPTR            SourceBuffer;
  668.     LONG            SourceLen;
  669.  
  670.     STRPTR            DestinationBuffer;
  671.     LONG            DestinationLen;
  672.  
  673.     struct TranslationEntry    **Table;
  674. };
  675.  
  676.     /* term hotkey configuration. */
  677.  
  678. struct HotkeysOld
  679. {
  680.     UBYTE            termScreenToFront[256];
  681.     UBYTE            BufferScreenToFront[256];
  682.     UBYTE            SkipDialEntry[256];
  683.     BYTE            CommodityPriority;
  684.     BYTE            HotkeysEnabled;
  685.  
  686.     ULONG            Reserved[25];
  687. };
  688.  
  689. struct Hotkeys
  690. {
  691.     UBYTE            termScreenToFront[256];
  692.     UBYTE            BufferScreenToFront[256];
  693.     UBYTE            SkipDialEntry[256];
  694.     BYTE            CommodityPriority;
  695.     BYTE            HotkeysEnabled;
  696.  
  697.     ULONG            Reserved[25];
  698.  
  699.     UBYTE            AbortARexx[256];
  700. };
  701.  
  702.     /* Time/date structure. */
  703.  
  704. struct TimeDate
  705. {
  706.     LONG             Count;        /* Table size. */
  707.     WORD             PayPerUnit[2],    /* Pay for each unit. */
  708.                  SecPerUnit[2];    /* Number of seconds each unit lasts. */
  709.     UBYTE             Time,        /* The time associated with this entry. */
  710.                  Pad;
  711. };
  712.  
  713.     /* Time date header information. */
  714.  
  715. struct TimeDateHeader
  716. {
  717.     UBYTE             Comment[22];    /* Comment for this entry. */
  718.  
  719.     BYTE             Month,        /* Month of year or -1 -> Day = bitmapped days of week. */
  720.                  Day;        /* Day of month or -1 -> standard settings. */
  721. };
  722.  
  723. struct TimeDateNode
  724. {
  725.     struct Node         VanillaNode;    /* Default node entry. */
  726.     UBYTE             Buffer[30];    /* Name buffer. */
  727.  
  728.     struct TimeDate        *Table;        /* Table of time/date entries. */
  729.  
  730.     struct TimeDateHeader     Header;    /* Header information. */
  731. };
  732.  
  733. struct TimeNode
  734. {
  735.     struct Node         VanillaNode;    /* Default node entry. */
  736.     UBYTE             Name[20];    /* Name string. */
  737.     UBYTE             Time;        /* The time for this entry. */
  738. };
  739.  
  740.     /* Serial settings. */
  741.  
  742. struct SerialSettings
  743. {
  744.     ULONG    BaudRate;        /* Baud rate. */
  745.     ULONG    BreakLength;        /* Length of break signal in microseconds. */
  746.     ULONG    SerialBufferSize;    /* Size of serial read/write buffer. */
  747.  
  748.     UBYTE    SerialDevice[MAX_FILENAME_LENGTH];
  749.                     /* Serial device name. */
  750.     LONG    UnitNumber;        /* Serial device unit number. */
  751.  
  752.     BYTE    BitsPerChar;        /* Bits per character. */
  753.     BYTE    Parity;            /* Parity check mode. */
  754.     BYTE    StopBits;        /* Number of stop bits. */
  755.     BYTE    HandshakingProtocol;    /* Handshaking protocol (RTS/CTS, etc.). */
  756.     BYTE    Duplex;            /* Full- or half-duplex? */
  757.  
  758.     BYTE    xONxOFF;        /* xON/xOFF handshaking enabled? */
  759.     BYTE    HighSpeed;        /* Radboogie? */
  760.     BYTE    Shared;            /* Shared device access? */
  761.     BYTE    StripBit8;        /* Strip high-order bit? */
  762.     BYTE    CheckCarrier;        /* Track the carrier signal? */
  763.     BYTE    PassThrough;        /* Pass xON/xOFF characters through to modem? */
  764.     BYTE    UseOwnDevUnit;        /* Enable OwnDevUnit.library? */
  765.  
  766.     ULONG    Quantum;        /* Buffer read quantum. */
  767.  
  768.     BYTE    IgnoreCarrier;        /* Ignore carrier signal. */
  769.  
  770.     BYTE    UseNet;            /* Use DNet-ID. */
  771.     UWORD    NetID;            /* The DNet-ID to use. */
  772. };
  773.  
  774.     /* Modem settings. */
  775.  
  776. struct ModemSettings
  777. {
  778.     UBYTE    ModemInit[80];        /* Modem init string. */
  779.     UBYTE     ModemExit[80];        /* Modem exit string. */
  780.     UBYTE     ModemHangup[80];    /* Modem hangup string. */
  781.     UBYTE    DialPrefix[80];        /* Dial command prefix. */
  782.     UBYTE    DialSuffix[80];        /* Dial command suffix. */
  783.  
  784.     UBYTE    NoCarrier[16];        /* `No carrier' string. */
  785.     UBYTE    NoDialTone[16];        /* `No dialtone' string. */
  786.     UBYTE    Connect[16];        /* `Connect' string. */
  787.     UBYTE    Voice[16];        /* `Voice' string. */
  788.     UBYTE    Ring[16];        /* `Ring' string. */
  789.     UBYTE    Busy[16];        /* `Busy' string. */
  790.  
  791.     LONG    RedialDelay;        /* Length of redial delay. */
  792.     LONG    DialRetries;        /* Number of dial retries. */
  793.     LONG    DialTimeout;        /* Length of dial timeout. */
  794.     BYTE    ConnectAutoBaud;    /* Use baud rate returned by modem? */
  795.     BYTE    DropDTR;        /* Drop the DTR signal on hangup? */
  796.     BYTE    RedialAfterHangup;    /* Redial list after hangup? */
  797.     BYTE    Pad;
  798.  
  799.     UBYTE    Ok[16];            /* `Ok' string. */
  800.     UBYTE    Error[16];        /* `Error' string. */
  801.  
  802.     BYTE    NoCarrierIsBusy;    /* Treat `NO CARRIER' as `BUSY' signal? */
  803.     BYTE    AbortHangsUp;        /* Dialer `Abort' sends hangup string? */
  804.  
  805.     WORD    ConnectLimit;                /* Connection limit. */
  806.     UBYTE    ConnectLimitMacro[MAX_FILENAME_LENGTH];    /* Macro to be executed when limit is reached. */
  807.  
  808.     LONG    TimeToConnect;        /* Number of seconds to pass between modem picking up
  809.                      * the line and issuing the `CONNECT' message.
  810.                      */
  811. };
  812.  
  813.     /* Command settings. */
  814.  
  815. struct CommandSettings
  816. {
  817.     UBYTE    StartupMacro[256];    /* Startup macro. */
  818.     UBYTE    LogoffMacro[256];    /* Macro executed after carrier has dropped or hung up. */
  819.     UBYTE    UploadMacro[256];    /* Macro to execute after a successful upload. */
  820.     UBYTE    DownloadMacro[256];    /* Macro to execute after a successful download. */
  821.  
  822.     UBYTE    LoginMacro[256];    /* Login macro, complements the logoff macro. */
  823. };
  824.  
  825.     /* Screen settings. */
  826.  
  827. struct ScreenSettings
  828. {
  829.     ULONG    DisplayMode;            /* Screen display mode. */
  830.     WORD    ColourMode;            /* The terminal colour mode. */
  831.     UWORD    Colours[16];            /* Colour palette. */
  832.     UBYTE    FontName[MAX_FILENAME_LENGTH];    /* Default user interface font. */
  833.     WORD    FontHeight;            /* Default user interface font height. */
  834.  
  835.     BYTE    MakeScreenPublic;        /* Are we to make our screen public? */
  836.     BYTE    ShanghaiWindows;        /* Are we to `shanghai' windows? */
  837.  
  838.     BYTE    Blinking;            /* Screen blinking enabled? */
  839.     BYTE    FasterLayout;            /* Faster screen layout? */
  840.     BYTE    TitleBar;            /* Is the screen title bar enabled? */
  841.     BYTE    StatusLine;            /* Which mode is the status line in? */
  842.  
  843.     BYTE    UseWorkbench;            /* Use the Workbench screen for the terminal window? */
  844.  
  845.     UBYTE    PubScreenName[MAXPUBSCREENNAME + 1];    /* Name of public screen to open window upon. */
  846.  
  847.     BYTE    TimeMode;            /* Online time/fee display. */
  848.     BYTE    Depth;                /* Screen depth if any, 0 = don't bother. */
  849.  
  850.     BYTE    UsePens;            /* Use special screen pens? */
  851.     BYTE    PenColourMode;            /* For which colour mode was the pen array built? */
  852.  
  853.     UWORD    PenArray[16];            /* Pen index array. */
  854.  
  855.     ULONG    DisplayWidth,            /* Screen width. */
  856.         DisplayHeight;            /* Screen height. */
  857.     UWORD    OverscanType;            /* Screen overscan type. */
  858.  
  859.     BYTE    ShareScreen;            /* Don't open a backdrop window, share pens. */
  860.     BYTE    SplitStatus;            /* Split the status line from the main window. */
  861. };
  862.  
  863.     /* Terminal settings. */
  864.  
  865. struct TerminalSettings
  866. {
  867.     BYTE    BellMode;                /* The bell mode. */
  868.     BYTE    AlertMode;                /* The user alert mode. */
  869.     BYTE    EmulationMode;                /* The terminal emulation mode. */
  870.     BYTE    FontMode;                /* The font mode. */
  871.  
  872.     BYTE    SendCR;                    /* Standard translations. */
  873.     BYTE    SendLF;
  874.     BYTE    ReceiveCR;
  875.     BYTE    ReceiveLF;
  876.  
  877.     UWORD    NumColumns,                /* Size of the terminal window. */
  878.         NumLines;
  879.  
  880.     UBYTE    KeyMapFileName[MAX_FILENAME_LENGTH];    /* Name of custom keymap file. */
  881.     UBYTE    EmulationFileName[MAX_FILENAME_LENGTH];    /* External emulation file name. */
  882.     UBYTE    BeepFileName[MAX_FILENAME_LENGTH];    /* Name of the custom beep sound file. */
  883.  
  884.     UBYTE    TextFontName[MAX_FILENAME_LENGTH];    /* Terminal text font name. */
  885.     WORD    TextFontHeight;                /* Terminal text font height. */
  886.  
  887.     BYTE    UseTerminalTask;            /* Enable the terminal emulation process. */
  888.     BYTE    Pad;
  889.  
  890.     UBYTE    IBMFontName[MAX_FILENAME_LENGTH];    /* Terminal text font name. */
  891.     WORD    IBMFontHeight;                /* Terminal text font height. */
  892. };
  893.  
  894.     /* Path settings. */
  895.  
  896. struct PathSettings
  897. {
  898.     UBYTE    ASCIIUploadPath[MAX_FILENAME_LENGTH];        /* Default ASCII upload file path. */
  899.     UBYTE    ASCIIDownloadPath[MAX_FILENAME_LENGTH];        /* Default ASCII download file path. */
  900.  
  901.     UBYTE    TextUploadPath[MAX_FILENAME_LENGTH];        /* Default text upload file path. */
  902.     UBYTE    TextDownloadPath[MAX_FILENAME_LENGTH];        /* Default text download file path. */
  903.  
  904.     UBYTE    BinaryUploadPath[MAX_FILENAME_LENGTH];        /* Default binary data upload file path. */
  905.     UBYTE    BinaryDownloadPath[MAX_FILENAME_LENGTH];    /* Default binary data download file path. */
  906.  
  907.     UBYTE    DefaultStorage[MAX_FILENAME_LENGTH];        /* Default configuration storage path. */
  908.  
  909.     UBYTE    Editor[MAX_FILENAME_LENGTH];            /* Text file editor to use. */
  910.  
  911.     UBYTE    HelpFile[MAX_FILENAME_LENGTH];            /* Help text file. */
  912. };
  913.  
  914.     /* Miscellaneous settings. */
  915.  
  916. struct MiscSettings
  917. {
  918.     BYTE    Priority;        /* Program priority. */
  919.     BYTE    BackupConfig;        /* Save the configuration between calls? */
  920.  
  921.     BYTE    OpenFastMacroPanel;    /* Open the fast! macro panel? */
  922.     BYTE    ReleaseDevice;        /* Release serial device when iconified? */
  923.  
  924.     BYTE    TransferServer;        /* Enable data transfer server? */
  925.     BYTE    EmulationServer;    /* Enable terminal emulation server? */
  926.  
  927.     BYTE    OverridePath;        /* Override the protocol transfer path? */
  928.     BYTE    AutoUpload;        /* Enable the auto-upload panel? */
  929.     BYTE    SetArchivedBit;        /* Set the archived bit for files sent? */
  930.     BYTE    IdentifyFiles;        /* Try to identify files after download? */
  931.  
  932.     BYTE    TransferIcons;        /* Transfer files along with their icons? */
  933.     BYTE    CreateIcons;        /* Create icons for files saved? */
  934.  
  935.     BYTE    SimpleIO;        /* Use simple file I/O? */
  936.     BYTE    PerfMeter;        /* Transfer performance meter enabled? */
  937.  
  938.     LONG    IOBufferSize;        /* Size of the asynchronous I/O buffer. */
  939. };
  940.  
  941.     /* Clipboard settings. */
  942.  
  943. struct ClipSettings
  944. {
  945.     WORD    ClipboardUnit;        /* Clipboard unit to use. */
  946.  
  947.     WORD    LineDelay,        /* Insert line delay. */
  948.         CharDelay;        /* Insert character delay. */
  949.  
  950.     UBYTE    InsertPrefix[80];    /* Line insertion prefix. */
  951.     UBYTE    InsertSuffix[80];    /* Line insertion suffix. */
  952.  
  953.     UBYTE    LinePrompt[256];    /* Line wait prompt. */
  954.     WORD    SendTimeout;        /* Line send timeout. */
  955.     UBYTE    PacingMode;        /* Text pacing mode. */
  956.     BYTE    Pad;
  957. };
  958.  
  959.     /* Capture and logfile settings. */
  960.  
  961. struct CaptureSettings
  962. {
  963.     BYTE    LogActions;                /* Create logfile? */
  964.     BYTE    LogCall;                /* Create callinfo-compatible logfile? */
  965.     UBYTE    LogFileName[MAX_FILENAME_LENGTH];    /* Default logfile name. */
  966.  
  967.     LONG    MaxBufferSize;                /* Maximum text buffer size. */
  968.     BYTE    BufferEnabled;                /* Is the text buffer enabled? */
  969.  
  970.     BYTE    ConnectAutoCapture;            /* Open capture file on logon? */
  971.     BYTE    CaptureFilterMode;            /* The capture filter mode. */
  972.     UBYTE    CapturePath[MAX_FILENAME_LENGTH];    /* The default path for capture files. */
  973.  
  974.     UBYTE    CallLogFileName[MAX_FILENAME_LENGTH];    /* Name of the call log file. */
  975.     UBYTE    BufferPath[MAX_FILENAME_LENGTH];    /* Text buffer save path. */
  976.  
  977.     BYTE    AutoCaptureDate;            /* Where to include the creation date? */
  978.     UBYTE    SearchHistory;
  979.  
  980.     BYTE    OpenBufferWindow;            /* Where to open the buffer window. */
  981.     BYTE    OpenBufferScreen;            /* Where to open the buffer screen. */
  982.  
  983.     BYTE    BufferScreenPosition;            /* Where to place the buffer screen (horizontal) */
  984.     UBYTE    BufferWidth;                /* How long each line in the buffer should be. */
  985.  
  986.     BYTE    RememberBufferWindow;            /* Remember buffer window context? */
  987.     BYTE    RememberBufferScreen;            /* Remember buffer screen context? */
  988.  
  989.     ULONG    BufferScreenMode;            /* Screen display mode for buffer screen. */
  990. };
  991.  
  992.     /* File settings. */
  993.  
  994. struct FileSettings
  995. {
  996.     UBYTE    ProtocolFileName[MAX_FILENAME_LENGTH];        /* Transfer protocol file name. */
  997.     UBYTE    TranslationFileName[MAX_FILENAME_LENGTH];    /* Character translation file name. */
  998.     UBYTE    MacroFileName[MAX_FILENAME_LENGTH];        /* Keyboard macro file name. */
  999.     UBYTE    CursorFileName[MAX_FILENAME_LENGTH];        /* Cursor key file name. */
  1000.     UBYTE    FastMacroFileName[MAX_FILENAME_LENGTH];        /* Fast macro file name. */
  1001. };
  1002.  
  1003.     /* Emulation settings. */
  1004.  
  1005. struct EmulationSettings
  1006. {
  1007.     BYTE    CursorMode;        /* Are the cursor keys switched to application mode? */
  1008.     BYTE    NumericMode;        /* Is the numeric keypad switched to application mode? */
  1009.  
  1010.     BYTE    CursorWrap;        /* Is cursor position wrapping enabled? */
  1011.     BYTE    LineWrap;        /* Is character line wrapping enabled? */
  1012.  
  1013.     BYTE    InsertMode;        /* Is the character insertion mode enabled? */
  1014.     BYTE    NewLineMode;        /* Is the newline mode enabled? */
  1015.  
  1016.     BYTE    FontScale;        /* Which font scale is enabled? */
  1017.     BYTE    ScrollMode;        /* Is smooth scrolling enabled? */
  1018.     BYTE    DestructiveBackspace;    /* Backspace erases characters? */
  1019.     BYTE    SwapBSDelete;        /* DEL and BS keys are swapped? */
  1020.     BYTE    PrinterEnabled;        /* Printer commands enabled? */
  1021.     BYTE    CLSResetsCursor;    /* Clear screen command resets cursor position? */
  1022.  
  1023.     UBYTE    AnswerBack[80];        /* Answer-back message. */
  1024.  
  1025.     BYTE    KeysLocked;        /* Numeric keypad mode locked? */
  1026.     UBYTE    MaxScroll;        /* Maximum number of lines to prescroll. */
  1027.     UBYTE    MaxJump;        /* Maximum number of lines to scroll in one jump. */
  1028.     BYTE    CursorLocked;        /* Cursor keys locked? */
  1029.     BYTE    FontLocked;        /* Font size locked? */
  1030.     BYTE    Pad;
  1031. };
  1032.  
  1033.     /* File transfer library settings. */
  1034.  
  1035. struct TransferSettings
  1036. {
  1037.     UBYTE    DefaultLibrary[MAX_FILENAME_LENGTH],
  1038.         ASCIIUploadLibrary[MAX_FILENAME_LENGTH],
  1039.         ASCIIDownloadLibrary[MAX_FILENAME_LENGTH],
  1040.         TextUploadLibrary[MAX_FILENAME_LENGTH],
  1041.         TextDownloadLibrary[MAX_FILENAME_LENGTH],
  1042.         BinaryUploadLibrary[MAX_FILENAME_LENGTH],
  1043.         BinaryDownloadLibrary[MAX_FILENAME_LENGTH];
  1044.     BYTE    InternalASCIIUpload,
  1045.         InternalASCIIDownload,
  1046.         QuietTransfer,
  1047.         MangleFileNames;
  1048.  
  1049.     WORD    LineDelay,        /* Insert line delay. */
  1050.         CharDelay;        /* Insert character delay. */
  1051.  
  1052.     UBYTE    LinePrompt[256];    /* Line wait prompt. */
  1053.     WORD    SendTimeout;        /* Line send timeout. */
  1054.     UBYTE    PacingMode;        /* Text pacing mode. */
  1055.     BYTE    StripBit8;        /* Strip high order bit. */
  1056.     BYTE    IgnoreDataPastArnold;    /* Ignore data past terminator. */
  1057.     UBYTE    TerminatorChar;        /* Terminator character. */
  1058.     BYTE    SendCR,
  1059.         SendLF,
  1060.         ReceiveCR,
  1061.         ReceiveLF;
  1062. };
  1063.  
  1064.     /* The new configuration settings. */
  1065.  
  1066. struct Configuration
  1067. {
  1068.     struct SerialSettings        *SerialConfig;
  1069.     struct ModemSettings        *ModemConfig;
  1070.     struct ScreenSettings        *ScreenConfig;
  1071.     struct TerminalSettings        *TerminalConfig;
  1072.     struct EmulationSettings    *EmulationConfig;
  1073.     struct ClipSettings        *ClipConfig;
  1074.     struct CaptureSettings        *CaptureConfig;
  1075.     struct CommandSettings        *CommandConfig;
  1076.     struct MiscSettings        *MiscConfig;
  1077.     struct PathSettings        *PathConfig;
  1078.     struct FileSettings        *FileConfig;
  1079.     struct TransferSettings        *TransferConfig;
  1080. };
  1081.  
  1082.     /* Phonebook entry header. */
  1083.  
  1084. struct PhoneHeader
  1085. {
  1086.     UBYTE    Name[40],        /* BBS name. */
  1087.         Number[100],        /* Phone number. */
  1088.         Comment[100];        /* Comment. */
  1089.  
  1090.     UBYTE    UserName[100],        /* User name for this BSS. */
  1091.         Password[100];        /* Password for user name. */
  1092.  
  1093.     BYTE    QuickMenu;        /* This entry appears in the quick dial menu? */
  1094.     BYTE    Pad;
  1095. };
  1096.  
  1097.     /* A phonebook entry. */
  1098.  
  1099. struct PhoneEntry
  1100. {
  1101.     struct PhoneNode    *Node;
  1102.  
  1103.     struct MinList         TimeDateList;
  1104.  
  1105.     LONG             Count;
  1106.  
  1107.     struct PhoneHeader    *Header;
  1108.     struct Configuration    *Config;
  1109. };
  1110.  
  1111.     /* A text box for several lines of text. */
  1112.  
  1113. struct TextBox
  1114. {
  1115.     struct TextBox        *NextBox;        /* Next box in chain. */
  1116.  
  1117.     LONG             Left,Top,        /* Position and size. */
  1118.                  Width,Height;
  1119.  
  1120.     LONG             LineWidth,        /* Line width in pixels. */
  1121.                  LineHeight;        /* Line height in pixels. */
  1122.  
  1123.     LONG             NumChars,        /* Number of chars per line. */
  1124.                  NumLines;        /* Number of lines. */
  1125.  
  1126.     STRPTR            *Title,            /* Line titles. */
  1127.                 *Text;            /* Line texts. */
  1128.  
  1129.     LONG             TitleFgPen,
  1130.                  TitleBgPen,
  1131.                  TextPen;
  1132. };
  1133.  
  1134.     /* Block marker structure. */
  1135.  
  1136. struct BlockMarker
  1137. {
  1138.         /* The object to manipulate. */
  1139.  
  1140.     APTR            Object;
  1141.  
  1142.         /* Selection and unselection routines. */
  1143.  
  1144.     VOID         (* Select)(struct BlockMarker *Marker,LONG Left,LONG Top,LONG Width,LONG Height);
  1145.     VOID         (* Unselect)(struct BlockMarker *Marker,LONG Left,LONG Top,LONG Width,LONG Height);
  1146.  
  1147.         /* Origin anchor point. */
  1148.  
  1149.     LONG            OriginX,
  1150.                 OriginY;
  1151.  
  1152.         /* First and last selected line. */
  1153.  
  1154.     LONG            FirstLine,
  1155.                 LastLine;
  1156.  
  1157.         /* First and last selected column. */
  1158.  
  1159.     LONG            FirstColumn,
  1160.                 LastColumn;
  1161.  
  1162.         /* Top of display window, lines in the buffer and size of
  1163.          * the display window.
  1164.          */
  1165.  
  1166.     LONG            Top,
  1167.                 Lines,
  1168.                 Width,
  1169.                 Height;
  1170.  
  1171.         /* Canvas left and top edge. */
  1172.  
  1173.     LONG            LeftEdge,
  1174.                 TopEdge;
  1175.  
  1176.         /* Last mouse position. */
  1177.  
  1178.     LONG            LastX,
  1179.                 LastY;
  1180.  
  1181.         /* Single character dimensions. */
  1182.  
  1183.     LONG            TextFontWidth,
  1184.                 TextFontHeight;
  1185.  
  1186.         /* Plane write mask. */
  1187.  
  1188.     UBYTE            WriteMask;
  1189. };
  1190.  
  1191.     /* Global data flow <-> term interface. */
  1192.  
  1193. struct FlowInfo
  1194. {
  1195.     BYTE            Changed;
  1196.  
  1197.     BYTE            NoCarrier,
  1198.                 ZModemUpload;
  1199.  
  1200.     BYTE            Connect,
  1201.                 Voice,
  1202.                 Ring,
  1203.                 Busy,
  1204.                 NoDialTone,
  1205.                 Ok,
  1206.                 Error;
  1207. };
  1208.  
  1209.     /* A scan sequence, somewhat similar to the FlowInfo structure. */
  1210.  
  1211. struct WaitNode
  1212. {
  1213.     struct Node    Node;
  1214.     LONG        Count;        /* Number of characters matched. */
  1215.     STRPTR        Response;    /* Immediate response. */
  1216.     LONG        ResponseLen;    /* Length of immediate response string. */
  1217. };
  1218.  
  1219. struct DialNode
  1220. {
  1221.     struct Node         Node;
  1222.     struct PhoneEntry    *Entry;
  1223. };
  1224.  
  1225.     /* A list as employed by the ARexx interface. */
  1226.  
  1227. struct GenericList
  1228. {
  1229.     struct MinList         ListHeader;
  1230.     struct Node        *ListNode;
  1231.     LONG             ListCount;
  1232.     struct SignalSemaphore     ListSemaphore;
  1233. };
  1234.  
  1235.     /* Number of buffers to be used for buffered I/O. */
  1236.  
  1237. #define BUFFER_NUMBER        2
  1238.  
  1239.     /* Auxiliary structure for buffered file I/O. */
  1240.  
  1241. struct Buffer
  1242. {
  1243.     struct Message             Message;            /* Vanilla message header. */
  1244.  
  1245.     BYTE                 SimpleIO;            /* Real simple I/O? */
  1246.     BYTE                 Pad;
  1247.  
  1248.     BYTE                 Read;                /* Last access has read data. */
  1249.     BYTE                 Written;            /* Last access has written data. */
  1250.  
  1251.     LONG                 Action;            /* Action to perform. */
  1252.     LONG                 ActionData[2];            /* Seek and the like. */
  1253.     LONG                 Result;            /* Return value. */
  1254.  
  1255.     BPTR                 FileHandle;            /* Dos filehandle. */
  1256.  
  1257.     UBYTE                *Data;                /* Data buffer. */
  1258.     LONG                 BufLength;            /* Length of data buffer. */
  1259.  
  1260.     LONG                 BufPosition;            /* Read/write pointer into buffer. */
  1261.  
  1262.     LONG                 ReadBufFull;            /* How many bytes are still to be read from the buffer? */
  1263.     LONG                 WriteBufFull;            /* How many bytes are still to be written to the buffer?*/
  1264.  
  1265.     LONG                 RealPosition;            /* Real position in file. */
  1266.     LONG                 Cached;            /* How many bytes in pre-load cache. */
  1267.  
  1268.     UBYTE                *DataBuffer[BUFFER_NUMBER];    /* The data buffers. */
  1269.     LONG                 DataLength[BUFFER_NUMBER];    /* The lengths of the data buffers. */
  1270.     WORD                 DataCount;            /* Which buffer to use. */
  1271.     BYTE                 WriteAccess;            /* TRUE if a write file handle. */
  1272.     BYTE                 LastActionFailed;        /* TRUE if last action failed -> abort actions. */
  1273.  
  1274.     struct Process            *Child;
  1275.     struct Process            *Caller;            /* Synchronization. */
  1276.  
  1277.     BPTR                 DirLock;
  1278.     struct InfoData __aligned     InfoData;
  1279.  
  1280.     BYTE                 Fresh;                /* TRUE if no read/write access has taken place yet. */
  1281.     BYTE                 Used;                /* Did any access take place at all? */
  1282.  
  1283.     struct DateStamp         OpenDate;            /* Date and time when file was opened. */
  1284. };
  1285.  
  1286.     /* xpr serial bits. */
  1287.  
  1288. #define ST_PARTYON    (1L << 0)
  1289. #define ST_PARTYODD    (1L << 1)
  1290. #define ST_7WIRE    (1L << 2)
  1291. #define ST_QBREAK    (1L << 3)
  1292. #define ST_RADBOOGIE    (1L << 4)
  1293. #define ST_SHARED    (1L << 5)
  1294. #define ST_EOFMODE    (1L << 6)
  1295. #define ST_XDISABLED    (1L << 7)
  1296. #define ST_PARTYMARKON    (1L << 8)
  1297. #define ST_PARTYMARK    (1L << 9)
  1298. #define ST_2BITS    (1L << 10)
  1299. #define ST_READ7    (1L << 11)
  1300. #define ST_WRITE7    (1L << 12)
  1301.  
  1302.     /* Miscellaneous definitions. */
  1303.  
  1304. #define MILLION        1000000
  1305.  
  1306.     /* Raster text line attributes. */
  1307.  
  1308. #define    ATTR_UNDERLINE    1
  1309. #define    ATTR_HIGHLIGHT    2
  1310. #define ATTR_BLINK    4
  1311. #define    ATTR_INVERSE    8
  1312.  
  1313.     /* Audio channels. */
  1314.  
  1315. #define LEFT0F  1
  1316. #define RIGHT0F  2
  1317. #define RIGHT1F  4
  1318. #define LEFT1F  8
  1319.  
  1320.     /* Program revision and the approriate info structure. */
  1321.  
  1322. struct TermInfo
  1323. {
  1324.     UWORD    Version;
  1325.     UWORD    Revision;
  1326. };
  1327.  
  1328. /**********************************************************************/
  1329.  
  1330.  
  1331.     // This defines the destructor data type
  1332.  
  1333. typedef VOID (* __stdargs DESTRUCTOR)(struct MsgItem *);
  1334.  
  1335.     // A message queue handle
  1336.  
  1337. struct MsgQueue
  1338. {
  1339.     struct SignalSemaphore     Access;    // Access semaphore
  1340.     struct MinList         MsgList;    // This is where the queue items go
  1341.  
  1342.     LONG             QueueSize,    // The length of the queue
  1343.                  MaxSize;    // The maximum size of the queue, may be 0
  1344.  
  1345.     struct MinList         WaitList;    // The list of tasks to wait for a wakeup signal
  1346.  
  1347.     struct Task        *SigTask;    // The owner of this handle
  1348.     ULONG             SigMask;    // The signal mask to wake up the owner
  1349.     WORD             SigBit;    // The bit allocated for the mask, may be -1
  1350.  
  1351.     BOOL             Discard;    // Discard or queue new items?
  1352. };
  1353.  
  1354.     // A message item as used by the queue manager
  1355.  
  1356. struct MsgItem
  1357. {
  1358.     struct MinNode         Link;        // List node link
  1359.     DESTRUCTOR         Destructor;    // Destructor routine if any
  1360. };
  1361.  
  1362.     // Your simple message item destructor setup
  1363.  
  1364. #define InitMsgItem(Item,Dest)    (((struct MsgItem *)Item) -> Destructor = (Dest))
  1365.  
  1366.  
  1367. /**********************************************************************/
  1368.  
  1369.  
  1370. enum    {    DATAMSGTYPE_WRITE,DATAMSGTYPE_WRITECLIP,
  1371.         DATAMSGTYPE_UPDATEREVIEW,DATAMSGTYPE_MOVEREVIEW,
  1372.         DATAMSGTYPE_SERIALCOMMAND,DATAMSGTYPE_UPLOAD,
  1373.         DATAMSGTYPE_COMMANDDONE,DATAMSGTYPE_MENU,
  1374.         DATAMSGTYPE_RENDEZVOUS,DATAMSGTYPE_SERIALCOMMANDNOECHO
  1375.     };
  1376.  
  1377.     // An extension of the MsgItem data type
  1378.  
  1379. struct DataMsg
  1380. {
  1381.     struct MsgItem    Item;    // The message item link
  1382.  
  1383.     LONG        Type;    // Message type
  1384.     UBYTE *        Data;    // Pointer to data area
  1385.     LONG        Size;    // Size of data area
  1386. };
  1387.  
  1388.  
  1389. /**********************************************************************/
  1390.  
  1391.     /* And now for something completely different... */
  1392.  
  1393. #include "termProtos.h"
  1394. #include "termData.h"
  1395. #include "termErrors.h"
  1396.